package cn.kevinproject.dingtalk_robot.robot;

import cn.kevinproject.dingtalk_robot.config.RobotProperties;
import org.jetbrains.annotations.NotNull;
import lombok.RequiredArgsConstructor;
import org.jetbrains.annotations.Nullable;
import org.springframework.stereotype.Component;

/**
 * @author kevin lau
 */
@Component
@RequiredArgsConstructor
public class RobotManger {

    private final RobotProperties robotProperties;

    public @Nullable Robot getRobot(@NotNull String name) {
        return robotProperties.getRobots().get(name);
    }
}
